<script setup lang="ts">
import ClusterConfigConstants from '../../constants/ClusterConfigConstants';
import { ActiveHealthCheckConfig } from '../../services/client';
import TimeSpanSelect from '../basic/TimeSpanSelect.vue';

const model = defineModel<ActiveHealthCheckConfig>({ required: true })

</script>

<template>
    <ElDescriptions :column="1" border style="width: 100%;">
        <ElDescriptionsItem label="Enabled">
            <ElSwitch v-model="model.enabled"></ElSwitch>
        </ElDescriptionsItem>
        <ElDescriptionsItem label="Policy">
            <ElSelect v-model="model.policy">
                <ElOption v-for="(policy, index) in ClusterConfigConstants.HealthCheck.Active.Policies" :key="index"
                    :label="policy" :value="policy">
                </ElOption>
            </ElSelect>
        </ElDescriptionsItem>
        <ElDescriptionsItem label="Path">
            <TimeSpanSelect v-model="model.path" clearable></TimeSpanSelect>
        </ElDescriptionsItem>
        <ElDescriptionsItem label="Interval">
            <TimeSpanSelect clearable v-model="model.interval"></TimeSpanSelect>
        </ElDescriptionsItem>
        <ElDescriptionsItem label="Timeout">
            <TimeSpanSelect clearable v-model="model.timeout"></TimeSpanSelect>
        </ElDescriptionsItem>
    </ElDescriptions>
</template>